﻿using Architecture.Domain.Service;
using Architeture.Domain;
using Architeture.Domain.DTO;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand.Goods;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler.Goods
{
    public class GoodsSelectCommandHandler : IRequestHandler<GoodsSelectCommand, GoodsPagedto>
    {
        protected readonly IGoodService goodService;

        public GoodsSelectCommandHandler(IGoodService goodService)
        {
            this.goodService = goodService;
        }

        public async Task<GoodsPagedto> Handle(GoodsSelectCommand request, CancellationToken cancellationToken)
        {
            return await goodService.GetGoodsInfo(request.pageindex, request.pagesize, request.gname, request.BPtion, request.ShelfLife, request.PL, request.EPtion);
        }
    }
}
